fixed null reference exception
fixed date format bug