bug fixes: file handling error