Fixed json check and removed logging to console