Added buggy error function