added array length check
Added GPF