Fix bug with refresh creating new element.

Fix bug with refresh creating new element.