fix missing error code in unload handler
Merge pull request #649 from ikkez/fix-unload

fix missing error code in unload handler