Fixed a bug in remove

object is not subscriptable (as we expect)