simplified code by not saving redundant data
fixed bug when opening folderpicker a second time