Better logic when motion detected