fixed some issues with stopping/restarting