revise code for local app