fixes some bugs about lib importing