fix function decl order to fix windows build