Added ability to toggle motion detection mode