Added if to index