You could implement the idea of @vishnumaiea shown in this thread:
I haven’t test it, but it apparently works well.