add callback to dom methods