Adding support for errors