Fixed problem with state