fix date picker closing inappropriately