Added error code for rearrangement