made error an object