fix duplicate function