Added check error method + tests