added another error check.