minor fix for error factory