fixing the bug with normality transform