changed type_redirect from int to char*