Add a check for "$DISPLAY" before starting X