offline detection
other small improvements