setting required bit code in-place, but failing