w changed to wb in save_file method