BUG: fix a vectorization issue