adding debug output
adding error mesage
adding error mesage
adding error mesage