add a handling for rotation