getDates method fixed