adding fopen on success