fixed uninstall and memory freeing