Updated to handle Exception