resolved circular logic json encoding error