Moved redirect to the callback