problem with references and def