Updates to better handle errors