fixed for empty output string