hash redirect function in main