motion detection works