loadStateOnStartup added