Added enum to control states.