update state now working