some changes and added pyinstaller runtime hook