Fix issue while iterationg over files