Made $app optional