added account loading, more robust routing