Correct code and remove duplicate.