Added logic to remove files from DB.