Add check to ensure repo dir defined