add windows os check and native lib error handling