opened file in binary mode to prevent utf-8 exception