removeBack contained an invalid call to isEmpty