fixed copypaste bug and refs