fixed redirect loop issue with routes/before actions