change type of time variable to unsigned long