improve empty string detection