this is called only once during startup