Changed how error handling works