fix button function