Fixing dom element removal