Error function altered