see previous comment about array cast outside your method