Added debuglogging