generallyly working, but need to preserve states when viewing map.