Add function to unload core