fix overflowing stack with large bool arrays