added tenant fix to oldAPI branch