fixing stackoverflow