redirect to correct page after loging