Handle errors; redirect on success