removed double declaration & corrected saved state