remove all usages of pcall and error