Set attributes and redirect inside callback