Removed loop in set_custom
Revert "Removed loop in set_custom"

This reverts commit 7a4fb87e9328a8b2d96dfb427596eb92773770d9.
Re-wrote the write command