Fixed the dynamic button add code.