add file watching logic