Fixed xml pref problem
added log.d for debugging