add refs now really works with a few minor bugs
fix bug with getting selections