caputring error to be yielded