Solved unreferenced pointer if empty stack