Fix library replace issue