Improved stop function in client-side

Change-Id: I8f331b58765061fbbdea12a0c603084a9f83837b