Properly attach load event to each button