added onError alert to debug