added more logic to button class