fixed a bug handing exception when getting or parsing date