Fixed duplicate code issue.