added logic to avoid header rows