Checks for button press