Solved button opening and closing issue