trying to fix the animation for the xbutton