Bug fix involving file operation