insert to matrix only when cell is empty