Added checking for error arguments