fixed nullPointer: resolve() fills the not used array elements with -1