fixed server bug; added random initialization