adding check for valid section