added error trapping for preorder