improve json validation