This is not going to work as expected. The code in this function is going to continue executing even if `search && pkg_count == 0` is true.