Is this error check supposed to be part of this PR?