added 'rb' to open commands