added uninstall function, fixed on_exit function