[fix] Prevent duplicate execution of a function