First check if the stack is already empty.