error handling in the case that a user tries to open a file without a
.txt extension