Adding error handling for IO size