Fix JavaScript Bug