second attempt to fix time bug