added better state and removed previous changes