Added Error throwing mechanism