added error message for invalid sequence