made some code changes and fixed sql uninstall