changing the order of some score update and restart code