fix cross line problem, improve code coverage