move SUBSITE check to after db connect