a bit of exception handling for reading