Fixed logging in to redirect properly