Fixed a bug in remove and tested it in main