Fixing undefined offset 1 in patchDb line 9