fixed incorrectly trying to raise an error