femoved write to file method