cleanup
added sleep to motion detection