support different orientation and rotation