server code crash fixed