Fix for stackoverflow