Add file controller
use the lock everywhere