fixing date value bug