added direction line in debugmode and fix bug