adding arraysize check to library