added break statement where it was needed.