fixed lib loading and array count