save the order of the leaf into database