fix: can't load saved state and do screenshot because only one callback ...

...function is allowed. Now everything is done inside one single callback function.