String value getting empty when null string