fix bug for multiple files