fixed hanging recovery procedure
fixed memleak
style