group null and err check