fix bug in toDirection