changed file_instance from 'rb' to 'r+'