added missing casting to int for simulator