Made redirect and redirectAction functions.