Fixed incorrect assertion
Added popup support