fixed redirect and name function