change check package function for compile time work