added try/except to reshaping data