fixing a bug with shift