added semicolon, made appDir nonglobal