handle types properly when removing items