add 302 case to handler function

this may need to change further to accomodate more statuscodes.