Worked on solving weird memory issue