Improved code directed to Wear
added logging