fix for double removal  (fixes #491)