add direction, fix seg when serv quit