fix calculating packageBase directory