Updated code to handle errors individually