fixed bug with filehandeling