Added state dependance to edit exercise.