replaced all use of time() with current_time(timestamp)