Correcting code to run app