fixed issue with errors not being emitted