Fixed js bug