replaced RuntimeException with Exception