Fixing a length check