Adding in time query