added form input option. fixed some recovery bugs.