Adding rotation handling