fixing err to error