Fixed some js bug