fixed iOS orientation and lifecycle problems