Added redis require
Fixed url checking function and sorting