fixed KeyError for time dict