lame solution to an outofboundE in lines merging