Fix button event calling wrong function