Fixed nullPointerException with attaching lines to boxes