finish remove function