fix leak error for bit operations