generate new element bug-fix