diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go
index c84d207f..1623d6a6 100644
--- a/v2/pkgs/tools.go
+++ b/v2/pkgs/tools.go
@@ -188,7 +188,7 @@ func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools
 	key := correctTool.Name + "-" + correctTool.Version
 	// Check if it already exists
 	if t.behaviour == "keep" && pathExists(t.folder) {
-		location, ok := t.installed[key]
+		location, ok := t.getInstalledValue(key)
 		if ok && pathExists(location) {
 			// overwrite the default tool with this one
 			err := t.writeInstalled(path)
@@ -336,6 +336,13 @@ func (t *Tools) SetBehaviour(behaviour string) {
 	t.behaviour = behaviour
 }
 
+func (t *Tools) getInstalledValue(key string) (string, bool) {
+	t.mutex.RLock()
+	defer t.mutex.RUnlock()
+	location, ok := t.installed[key]
+	return location, ok
+}
+
 func pathExists(path string) bool {
 	_, err := os.Stat(path)
 	if err == nil {