update direction