catch error in case there is no internet connection on attach