Fixed a stackoverflowException