error handling in proof_check_tstp