initialize gerr to NULL