Change raising error to be easier and more readable