isTimeBetween function bug was fixed