fixing small bug in prepare_message method: type object argument after ** must be a mapping, not NoneType