Trying to understand the callback function.

Added an alert to see if the logic is reaching it.