Adding $app variable to register