added malloc in time sync