fixed redirect issue with sessions, added redirect($to) to setup.php