debug message fix and small changes