improve handling of cookies so widges is not initialised blindly