File writing hooks not functionning properly ??