fixed bugs.  added debug line.