added more debug echo statements