fixing time bug