stop open and closing files