added server-side logic