added checks for 'shift' state