Fix use of state property in component