Fixed the remove function