Fixed the shift query