Added more detailed management for buttons