Fixing date bug