fix basepath not being set when site is not in safe mode