added conditional and break