Fixed bug when saving selection