changed keepButtons implementation