added dynamic keyItem check