updated the build.sh and added the ondestroy function to main.py