Fix motion plugin when db empty