Added an error listener