better handling for the date picker