Override CreateElement function