add a rescue block for the nil to hash error that keeps happening