my changes to library , getpercent to check menu is open or not