adding conditionals to index