Fixed the element disappearing bug