new update , added multiple client support and added error threads