Replaced String.isEmpty()

Because apparently that's not available on some devices. Weird.
Updated version