adjusted error handling when there is no connection