first approach on error detection