Improved logging in main.py
Delayed thread execution
Catched general exception in main.py