handle boolean in as_dict