fixing issue with sorting after column removal/addition