Fixes stack overflow