fixed goal-checking in the viewer