fixing ruby hash error