fix installation order issue & matrix variable typo