changed name to userid in query