Fixed duplicate function