Version 3.1001 release - motion detection only running when active(code optimised)