implemented fixes for restart after reset problem