updated searches so that crash doesnt occur on log in. I just added some conditional assignments so if the odrerering hash does not have a :sort key, then we make it have one