now only removing last element if vector size is greater than 2