added loading parameters on start adn saving on exit