Fixed remove function