Update goal.js

Bug fix & renaming