protection for invalid data