Fixing small bug (js)