fixed some date bugs