added rotation (correct the rotation directory if false)