Make sure to return properly after error