add method to check wether the state can pop off