fixing up how errors are sent back to user

making sure that errors sent back to the user are `instanceof Error`