returning correct value when writing a byte array to a file
fixed delete file method