changes to dynamicButton

Added changes that should have been put in the Commit 2 minutes ago