fix (if $buttons is undefined)