Error function corrected