fix wrong order in inserting