ugly code to get blob detection semi working