sorts out selectDate issue