added reloading parameter to on_load and on_unload