stream is protected, and added implementation of patient_handler