Added check to prevent another error from being thrown.