added dynamic button management