updated to work with space in filename