fixing bug when appDir is changed