fixed bug in client's recv function