Fixed duplicate code error