added try/catch for inconsistent orientation