made file handling more verbose