Fixed creating DOM object issue