Bug fix to work with newest motion version