Incrementing id wrong on server side