corrected some errors in coap implimentation