trying to add error handling to mcard