Solved bug in deletion of dom attributes