fix bug in swing generator