define the setUser function ahead of time