Fixed bug in time synchronization