modified throwing

-changed from throwing error to throwing exception