Error function added
Error function added