[issue #176 #170 #169] [WIP] fixes bugs in the popover