Profile references before assigned. fix #3220