watch.py modification and fixing some errors