Checking max time before insert