fix goals bug
refactored