add file mode hook