handling error
support reordering