Added error message if unable to open X.