fixed undefined json entities check