recovery: improverd logging
recovery: more defensive programming