Solve refrence errors