implemented check button and debug event listener