add test cases for nil and empty string