fix bug in js packaging logic