fix: array cast to invalid length