Added logic for adding files