handle errors in launching preferences window better