fix some bug and add the direction image