fix a the None result bug for failing functions