fixed condiditon on getStrToGoal