added check for redirectid to add class