fixed some references crashes