Added a check if the worker can not connect to server

+ small typos in last commit on model.py