Broken implementation. Infinite loop in load function