Fix bug in server