Changed logic for time limit