check reference exists before looking for it in local storage