using text mode insted of binary mode