Added useful redirect logic