Change from "r" as a variable name to "dialog". "r" is commonly used for registrations,