bug fix [err ref]