fixes #36 and few other bugs
Reverted popover dynamic optimization