Added multi tenancy and fixed deleted bug.