minor
Added the buffer

made some changes in client and server to remove cosmetic errors
Added lock for the buffer

Added Lock for the buffer and added logging information