Implemented counter and validation/error handling