motion detection added