modify remove method in stack