added global to redirect callback