added logic for reset button