Javascript fix after move