(fix) pattern guard does not allow mutable borrowing