Added checkItem function