Fix buttonclick handler