fix date detection