implement popup + bugfixes