Fixed bug with buttons event handlers