Added error function and wire lib