reworked attaching errors to resources