solve the removing bug without return value