getting the code to work when running apps locally