fix time selection bug