solving date problem