fixed issues with wrong array type