Fixed bug when opening newly-created element
