implemented writing to characteristic