updated gem for cases when a MID does not exist and a 404 is raised