set basepath as a parameter, fixed manager_name handling