removing set state
fixing root detection