fix error path NULL arg