fix time generation