fixed bug with run function and added recovery page