fixed some js stuffs