fix basepath called on nil error