added periodic bg refresh (close #2)