add check for reference