check len (should fix #1165694)