Working on file write, getting bad file descriptor error