Added code with exceptions