fixed view logic for nil and empty string