fix multiple calling of beforeMove