now saves state to config