Modified callback implementation