fixed datestr bug