Query Update

Updated query for motion_history to store all available data