fix duplicate function definition