Replaced undefined $TIME variable with $time.