Fixed wrong function call

Use string.isEmpty() instead of empty()