fixed bug in exit redirect