time query fixes