javascript parser fixing