fixed duplicate function and missing include