fixed some race conditions
more HA work