now handles multiple buttons on one page