fixed detection of too large element