fixed server bugs (hopefully)