make reconnect work when backgrounded