Update scoping in app js