moved exception to more logical place