modify direction func