changed the call to _stats

changed the call in the end of the onerror event handler to the callback function "_stats" instead of the internal function "stats"