added error statement; stops loop if no chromosome is found