added code for LogCat debugging