Pull Request  Issues #449 after modification for client mode.