time calculate fix