solved the issue of printing empty strings