fix the bug in isValidTrashedIndex, add in recover
add recover
test recover