event listener for buttons doen's work properly