Add addtional error checking.