Fixed problem with goal being reset all the time

created a new boolean variable that solves the problem