Fixed an undefined method for Hash error