added auto rotation