added check if moving