Added better time handling