adding time_out function