added id checks to serializeUser