fix for memory leak after using selections