debugging remove function