several changes to handle errors