fix return index bugs in error page