Fixing a bug with buttons