improved RestUtils check method