Optimize adding files

Fixes the lag