fix problem with references