added support for eeror handling