fixed incorrect cast to array