Changing order of app directory checking

Thanks @jakev
This is the same change as pull request #49
Closes #49