Switched to raise for error handling