more efficient check for existing dep