fixed orientation and added permissions