hooked the motion detection to the plugin