Added error catches.