added new check on index