fix offline detection