animate flask and fixed popover bug