motion sensors worked until I broke it with code refactoring