default leaf detection