Thank you so much for this code! You really helped me out trying to implement this exact feature!
you're welcome
good luck with your project