Fix my bad javascript