refactor offline alert