Added processErr() function