Small fix on is_successful function