added some conditional code to fix staff pages without teams