adding guard for the callback condition