added debugging
added more logging