Added motion detection support