added empty check