fix nothing-condition, return nothing on sampling error