hard bug fix, AnyObject as Int does not work, use Int() always