Added a simple counter and some fault tollerence