implemented GetFree, ReadMessage and WriteMessage