fix #166, check for overflowing array growth