catching toJSON error and restarting with next