Fixed callback logic