Fix bug in setAppPath to assign the right path based on the env