bugfixing
popup internal refactoring