fixed problems withredorect