fixed bug with time difference check