Fix duplicate function