added two try exceptions