make sure item exists before accessing it