Solution for undo popup window leak issue

Just open an issue explaining the bug the issue number i think is #31,
and this pull request fix the bug.

Thanks for your contribution sharing this great lib ;)