Added functionality to check if entered times were invalid