Using button state to detect the button press only one time.