File handeling updated