Adding focus state
Adding offline detection for refresh