these should be inside if options.buttons[location]

in this implementation they are emptied even if developer wants the previous buttons for that location to stay(by not including them in options)