improve server-side and update db