fixed check before foreach in monstring.class