local state change working