take picture after motion is detected