added error handling to imdb api