Added support for setdirection