update recovery logic based on working 2.4.1 jar