Added checks for button clicks etc.