Handled excpetions for empty string