fixed some cases when using references