Fixing an issue with the time() method