replacing now() with time()