recv function fixed, so binary input works