Added error checking for the google charts promise.