Added case for empty string for datetime