bug fixes for service discovery, and statefulnes is now saved