handling lost connection
added namespace for calling functions