Because if this function runs in the dispatch function, I am not able to use the $config variable in the sessionCheck()