changing basepath variable to  variable