added headcounter, added proper removing of firebase when dc