Tweak to apply tenancy php