Exception handling added
Exception handling adjusted