Added extra if param in forcing orientation change