some changes to support jna 4