changed how error handling works