Fixed stack empty exception