putting guards around tests and index value