added exception throwing rather than straight up seg faulting