bf: fix order of operations