fix logged in & redirect problem