Fixed bug with redirect