Prevent popping from empty deque error