fix bugs
add recovery logic