adds locals ref