change default open_mode to r+