added some exception and removed bugs