fixing err ref