Added check for empty items