server: fix off by one