Motion detection is finally working