fixed ha to handle declare_dead_time

fixed ha to handle declare_dead_time and cleanup of flush setters