Fixed removing elements

Fixed removing elements