Fix runtime error at Log.d