Fixed stackOverflow error