trim() added into isEmpty function.