fix bug in lang function