bug in clearMatrix solved