Fixed bug with new errors function