fixing date bug