fixing nil id