Fix check_goal and insert_goal in userio.js