fix location js bug