Fix - clear stack if it is not empty before processing text