Have you set the variable gender? Otherwise it seems that in the Code before there may be an " without a second one, so that the code sees the " before the ( as the beginning of a new quote
Than I would look for a stray ", the error code points in this direction you could check this fast, if you put a another " after the second one and run a new test, if ther is no error there must be a leftover somewhere before the code snippet you posted