What error do you get? Have you created multiple ui buttons and have them set to call this code on different objects?
Also, please use code tags: