Added header row output
Bug fix