add error handling for checking out books