Fixed crash on unload