wrong use of trim in js