many bug fixes for buttons