fixed syntax error for pattern matching a struct