fix for switching apps locally and getting the right environment