fixed issue with appDir being dealocated on runtime