Edited update time function