fix the bug of calculation of normal matrix