added time logic