respect middleware errors