discovered that this code has running out space issue