Added counter thanks to exit_