fix bug in externs