fix undefined method `shift` error