save to DB only if user is logged in