added array check to initialization and corresponding test