changed restart to replace running instances with newly started after healthcheck succeeds
fixed some issues